package util;

import domain.entity.base.UserInfo;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

public class WebContextUtil {

    public static UserInfo getCurrentUser() {
        Subject subject = SecurityUtils.getSubject();
        Session session = subject.getSession();
        UserInfo currentUser = (UserInfo) session.getAttribute("user");
        return currentUser;
    }

}